﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SiteLib.Data;
using SiteLib.Tools;

namespace SiteLib.Master
{
    public partial class ViewPageAdmin : System.Web.UI.MasterPage
    {
        private void FillInfoBlockMenu()
        {
            List<SiteContent> scList = SiteContent.ListAllContent((int) EnumHelper.ContentType.Default);
            if (scList != null && scList.Count > 0)
            {
                rptInfoBlock.DataSource = scList;
                rptInfoBlock.DataBind();
            }
        }

        private void FillListMenu()
        {
            List<SiteContentType> sctList = SiteContentType.GetAllContentTypes();
            if (sctList != null && sctList.Count > 0)
            {
                rptListBlock.DataSource = sctList;
                rptListBlock.DataBind();
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                FillInfoBlockMenu();
                FillListMenu();
            }
        }
    }
}